﻿//Write a program that creates an array containing all letters from the alphabet (A-Z).
//Read a word from the console and print the index of each of its letters in the array.


using System;

public class IndexOfEachLettersInArray
{
    public static void Main()
    {
        char[] letterArray = new char[26];
        for (int i = 0; i < 26; i++)
        {
            letterArray[i] = (char)(i + 65);
        }
        Console.Write("Enter word: ");
        string word = Console.ReadLine().ToUpper();
        char[] wordToChar = new char[word.Length];
        for (int i = 0; i < word.Length; i++)
        {
            wordToChar[i] = word[i];
        }
        for (int i = 0; i < wordToChar.Length; i++)
        {
            for (int j = 0; j < letterArray.Length; j++)
            {
                if (wordToChar[i] == letterArray[j])
                {
                    Console.WriteLine("Letter {0} index is: {1}", wordToChar[i], j);
                }
            }
        }
    }
}